#include <cctype>
#include <iostream>
#include <string>
#include <vector>

using i128 = __int128_t;
using ll = int64_t;

static ll n, m;
static const ll mod = 1e9+7;
static std::vector<std::vector<ll>> a;

static inline constexpr ll strp(const std::string &s, ll p) {
    ll num = 0;
    int idx = 0;
    ll nag = 1;
    if (s[0] == '-') {
        nag = -1;
        idx = 1;
    }
    for (size_t i = idx; i < s.length(); ++i) {
        num = (num * 10 + (s[i] - '0')) % p;
    }
    num = (num * nag) % p;
    if (num < 0) {
        num += p;
    }
    return num;
}

int main() {

    std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);

    std::cin >> n >> m;
    a.resize(n + 1, std::vector<ll>(1));
    for (int i = 0; i <= n; ++i) {
        std::string tmpstr;
        std::cin >> tmpstr;
        for (size_t k = 0; k < 1; ++k) {
            a[i][k] = strp(tmpstr,mod);
        }
    }

    std::vector<ll> sol;
    sol.reserve(100);

    for (ll i = 1; i <= m; ++i) {
        bool isok = true;
        for (size_t k = 0; k < 1; ++k) {

            const ll p = mod;
            const auto &cur = a;

            ll curx = 1;
            i128 sum = 0;

            for (int j = 0; j <= n; ++j) {

                sum += (i128)cur[j][k] * curx;
                curx = (curx * i) % p;

                if ((j & 15) == 15) {
                    sum %= p;
                }
            }

            sum %= p;

            if (sum != 0) {
                isok = false;
                break;
            }
        }

        if (isok) {
            sol.push_back(i);
        }
    }

    std::cout << sol.size() << '\n';
    for (ll ans : sol) {
        std::cout << ans << '\n';
    }

    return 0;
}
